<?
require_once("../core.php");

@get_all_variables();
$db = dbconnect();

$g = "question".$msgid;
$g = htmlspecialchars(addslashes($$g));

$q = "INSERT INTO `messages` ( `text` , `source` , `dest` )
VALUES (
 '$g', '0', '$sender'
);";
$r = mysql_query($q, $db) or die (mysql_error());

$q = "DELETE FROM `messages` WHERE `id` = $msgid";
$r = mysql_query($q, $db) or die (mysql_error());

header('Location: inbox.php');
?>
